"""
For 循环
"""

# a = ['apple', 'orange', 'banana', 'grape']
#
# for x in a:
#     print(x)

# b = [['apple', 'orange', 'banana', 'grape'], (1, 2, 3)]
# for x in b:
#     for y in x:
#         print(y)
#         # print(y, end='')
# else:
#     print('for id done')

# a = [1, 2, 3]
# for x in a:
#     if x == 2:
#         continue
#         # break
#     print(x)
# else:
#     print('EOF')


# for x in range(0, 10):
#     print(x)

# for x in range(0, 10, 2):
#     print(x, end=' | ')


# for x in range(10, 0, -2):
#     print(x, end=' | ')

# 间隔打印 1 | 3 | 5 | 7 |
a = [1, 2, 3, 4, 5, 6, 7, 8]
# for i in range(0, len(a), 2):
#     print(a[i], end=' | ')

b = a[0:len(a):2]
# print(b)

d = [1, 2, 3, 4, 5, 6, 7, 8]
